/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.utn.tpsimulacion05.UI;

/**
 *
 * @author juan
 */
public class VentanaEstadisticas extends javax.swing.JFrame {
    
 private VentanaSimulacion ventanaSimulacion;
    

    /**
     * Creates new form VentanaEstadisticas
     */
    public VentanaEstadisticas() {
        initComponents();
        
    }

    public VentanaEstadisticas(VentanaSimulacion ventanaSimulacion) {
        initComponents();
        this.ventanaSimulacion = ventanaSimulacion;     
        this.lbl_Min_Espera.setText(this.lbl_Min_Espera.getText() + ventanaSimulacion.getP().getBahia().getMinimoTiempoEnBahia() + " dias.");
        this.lbl_Max_Espera.setText(this.lbl_Max_Espera.getText() + ventanaSimulacion.getP().getBahia().getMaximoTiempoEnBahia() + " dias.");
        this.lbl_Media_Espera.setText(this.lbl_Media_Espera.getText() + ventanaSimulacion.getP().getBahia().getMediaTiempoEspera() + " dias.");
        this.lbl_Uso_Grua_1.setText(this.lbl_Uso_Grua_1.getText() + ventanaSimulacion.getP().porcentajeUsoGrua1() + " %.");
        this.lbl_Uso_Grua_2.setText(this.lbl_Uso_Grua_2.getText() + ventanaSimulacion.getP().porcentajeUsoGrua2() + " %.");

    }
     
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        lbl_Min_Espera = new javax.swing.JLabel();
        lbl_Max_Espera = new javax.swing.JLabel();
        lbl_Media_Espera = new javax.swing.JLabel();
        lbl_Uso_Grua_1 = new javax.swing.JLabel();
        lbl_Uso_Grua_2 = new javax.swing.JLabel();
        lbl_Uso_Muelle_1 = new javax.swing.JLabel();
        lbl_Uso_Muelle_2 = new javax.swing.JLabel();
        btn_Cerrar = new javax.swing.JButton();

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Estadisticas de Simulación");
        setBackground(new java.awt.Color(255, 255, 255));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Estadísticas"));

        lbl_Min_Espera.setText("Minima espera en bahia: ");

        lbl_Max_Espera.setText("Maxima espera en bahia: ");

        lbl_Media_Espera.setText("Media de permanencia de barcos en bahia: ");

        lbl_Uso_Grua_1.setText("Porcentaje de utilizacion de la grua 1: ");

        lbl_Uso_Grua_2.setText("Porcentaje de utilizacion de la grua 2: ");

        lbl_Uso_Muelle_1.setText("Porcentaje de utilizacion del muelle 1: ");

        lbl_Uso_Muelle_2.setText("Porcentaje de utilizacion del muelle 2: ");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbl_Min_Espera)
                    .addComponent(lbl_Max_Espera)
                    .addComponent(lbl_Media_Espera)
                    .addComponent(lbl_Uso_Grua_1)
                    .addComponent(lbl_Uso_Grua_2)
                    .addComponent(lbl_Uso_Muelle_2)
                    .addComponent(lbl_Uso_Muelle_1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbl_Min_Espera)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Max_Espera)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Media_Espera)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Uso_Grua_1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Uso_Grua_2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Uso_Muelle_1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_Uso_Muelle_2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        btn_Cerrar.setText("Cerrar");
        btn_Cerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CerrarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 467, Short.MAX_VALUE)
                        .addComponent(btn_Cerrar))
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btn_Cerrar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_CerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CerrarActionPerformed
        this.dispose();
    }//GEN-LAST:event_btn_CerrarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        
        
        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new VentanaEstadisticas().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Cerrar;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel lbl_Max_Espera;
    private javax.swing.JLabel lbl_Media_Espera;
    private javax.swing.JLabel lbl_Min_Espera;
    private javax.swing.JLabel lbl_Uso_Grua_1;
    private javax.swing.JLabel lbl_Uso_Grua_2;
    private javax.swing.JLabel lbl_Uso_Muelle_1;
    private javax.swing.JLabel lbl_Uso_Muelle_2;
    // End of variables declaration//GEN-END:variables
}
